﻿ 

//work.js
// self 是当前worker的global对象

//监听 父线程的消息




self.addEventListener('message', function(e) {
  self.postMessage('You said: ' + e.data);
}, false)

self.onmessage = function(event) {
  var method = event.data.method;
  var args = event.data.args;

  

function doSomething(args)
{
	return args+":Done in worker!";
}

var reply = doSomething(args);
 

self.postMessage({method: method, reply: reply});
}